import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import styleImport from 'vite-plugin-style-import';
import { resolve } from 'path'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    vue(),
    styleImport({
      libs: [
        {
          libraryName: 'vant',
          esModule: true,
          resolveStyle: (name) => `vant/es/${name}/style`,
        },
      ],
    })
  ],
  resolve: {
    alias: {
        "/@": resolve(__dirname, './src'), // 路径别名
      },
    extensions: ['.ts', '.js', '.tsx', '.jsx'],
  }
})
